package com.hxc.ann;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

import java.util.Date;

@Aspect
@Component
public class Log {

    @Pointcut(value = "@annotation(com.hxc.ann.Syslog)")
    public void pt(){

    }

    @Around(value = "pt() && @annotation(syslog)")
    public Object log(ProceedingJoinPoint pjp,Syslog syslog) throws Throwable {
        System.out.println("这是添加方法"+new Date());
        return pjp.proceed();
    }
}
